package com.yueqian.sc.bean;

/**
 * 根数据库中users表对应的实体类，用来封装从数据库查询回来的数据，或者封装需要传递到数据库的参数
 */
public class Users {
    private int userId;// 用户编号
    private String username;// 登录账户，教师是工号，学生是学号
    private String password;// 登录密码
    private String nickname;// 真实姓名
    private String gender;// 性别
    private String phone;// 电话
    private String specialty;// 学生专业，教师没有
    private String grade;// 学生年级，教师没有
    private String rank;// 教师职称，学生没有
    private String pic;// 头像地址
    private int role;// 角色：0：管理员，1：教师，2：学生
    private int delFalg;// 删除标识：0：未删除，1：已删除
    // 封装快捷键:alt+insert


    public Users() {
    }

    /**
     * 封装教师数据
     * @param userId
     * @param username
     * @param password
     * @param nickname
     * @param gender
     * @param phone
     * @param rank
     * @param pic
     * @param role
     * @param delFalg
     */
    public Users(int userId, String username, String password, String nickname, String gender, String phone, String rank, String pic, int role, int delFalg) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.gender = gender;
        this.phone = phone;
        this.rank = rank;
        this.pic = pic;
        this.role = role;
        this.delFalg = delFalg;
    }

    /**
     * 封装学生数据
     * @param userId
     * @param username
     * @param password
     * @param nickname
     * @param gender
     * @param phone
     * @param specialty
     * @param grade
     * @param pic
     * @param role
     * @param delFalg
     */
    public Users(int userId, String username, String password, String nickname, String gender, String phone, String specialty, String grade, String pic, int role, int delFalg) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.nickname = nickname;
        this.gender = gender;
        this.phone = phone;
        this.specialty = specialty;
        this.grade = grade;
        this.pic = pic;
        this.role = role;
        this.delFalg = delFalg;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSpecialty() {
        return specialty;
    }

    public void setSpecialty(String specialty) {
        this.specialty = specialty;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getRank() {
        return rank;
    }

    public void setRank(String rank) {
        this.rank = rank;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public int getDelFalg() {
        return delFalg;
    }

    public void setDelFalg(int delFalg) {
        this.delFalg = delFalg;
    }

    @Override
    public String toString() {
        return "Users{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", nickname='" + nickname + '\'' +
                ", gender='" + gender + '\'' +
                ", phone='" + phone + '\'' +
                ", specialty='" + specialty + '\'' +
                ", grade='" + grade + '\'' +
                ", rank='" + rank + '\'' +
                ", pic='" + pic + '\'' +
                ", role=" + role +
                ", delFalg=" + delFalg +
                '}';
    }
}
